<?php
/**********************************************************************************
WIKINDX: Bibliographic Management system.
Copyright (C)

This program is free software; you can redistribute it and/or modify it under the terms 
of the GNU General Public License as published by the Free Software Foundation; either 
version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; 
if not, write to the 
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

The WIKINDX Team 2007
sirfragalot@users.sourceforge.net
**********************************************************************************/
/*****
*	Collection Map class.
*	Provides mappings between resource types and collection types.  Allows for displaying only certain 
*	collections appropriate to the resource type when entering a new resource.
*
*	$Header: /cvsroot/wikindx/wikindx3/core/collection/COLLECTIONMAP.php,v 1.10 2007/08/28 15:39:17 sirfragalot Exp $
*****/
class COLLECTIONMAP
{
/*
* Constructor
*
* @author Mark Grimshaw
* @version 1
*/
	function COLLECTIONMAP()
	{
		$this->loadMap();
	}
/*
* @author Mark Grimshaw
* @version 2
*
* Commented out lines are from v3.6
*/
	function loadMap()
	{
		$this->collectionTypes = array(
				'book_article'			=>	'book',
				'book_chapter'			=>	'book',
				'journal_article'		=>	'journal',
				'newspaper_article'		=>	'newspaper',
				'magazine_article'		=>	'magazine',
				'web_article'			=>	'web',
				'web_encyclopedia_article'			=>	'web',
				'conference_paper'		=>	'proceedings',
				'proceedings_article'		=>	'proceedings',
				'thesis'			=>	'thesis',
				'manuscript'			=>	'manuscript',
				'music_track'			=>	'music',
				'miscellaneous_section'			=>	'miscellaneous',
			);
		$this->book = array(
				'resource'	=>	array(
					'field1'	=>	'seriesTitle',
					'field2'	=>	'edition',
					'field3'	=>	'seriesNumber',
					'transTitle'	=>	'title',
					'transSubtitle'	=>	'subtitle',
				),
				'resource_misc'	=>	array(
					'publisher'	=>	'publisher',
					'miscField1'	=>	'transPublisher',
					'miscField4'	=>	'numberOfVolumes',
					),
				'resource_year'	=>	array(
					'year1'		=>	'publicationYear',
					'year2'		=>	'reprintYear',
					'year3'		=>	'volumeYear',
					'year4'		=>	'transPublicationYear',
				),
				'resource_creator' =>	array(
					'creator2'	=>	'editor',
					'creator3'	=>	'translator',
					'creator4'	=>	'reviser',
					'creator5'	=>	'seriesEditor',
				),
// In addition to the collectionType, title and shortTitle of the collection, all these fields must match in order for a new collection to be judged to be the same as an existing one
				'match' => array('field1', 'field2', 'field3', 'publisher', 'year1'),
// Minimum fields for display of collection in selection box in addition to title and titleshort
				'display' => array('field2', 'year1'),
			);
		$this->journal = array(
				'resource'	=>	array(
//					'field1'	=>	'journalVolumeNumber',
//					'field2'	=>	'journalIssueNumber',
				),
				'resource_misc'	=>	array(
//					'miscField3'	=>	'month',
//					'miscField6'	=>	'endMonth',
					),
				'resource_year'	=>	array(
//					'year1'		=>	'publicationYear',
//					'year3'		=>	'endPublicationYear',
				),
				'resource_creator' =>	array(
				),
// In addition to the collectionType, title and shortTitle of the collection, all these fields must match in order for a new collection to be judged to be the same as an existing one
//				'match' => array('field1', 'field2', 'year1'),
				'match' => array(),
// Minimum fields for display of collection in selection box in addition to title and titleshort
//				'display' => array('field1', 'field2', 'year1'),
				'display' => array(),
			);
		$this->newspaper = array(
				'resource'	=>	array(
					'field2'	=>	'city',
				),
				'resource_misc'	=>	array(
					),
				'resource_year'	=>	array(
				),
				'resource_creator' =>	array(
				),
// In addition to the collectionType, title and shortTitle of the collection, all these fields must match in order for a new collection to be judged to be the same as an existing one
				'match' => array('field2'),
// Minimum fields for display of collection in selection box in addition to title and titleshort
				'display' => array('field2'),
			);
		$this->magazine = array(
				'resource'	=>	array(
				),
				'resource_misc'	=>	array(
					),
				'resource_year'	=>	array(
				),
				'resource_creator' =>	array(
				),
// In addition to the collectionType, title and shortTitle of the collection, all these fields must match in order for a new collection to be judged to be the same as an existing one
				'match' => array(), // empty array required
// Minimum fields for display of collection in selection box in addition to title and titleshort
				'display' => array(), // empty array required
			);
		$this->proceedings = array(
				'resource'	=>	array(
					'field1'	=>	'seriesTitle',
				),
				'resource_misc'	=>	array(
					),
				'resource_year'	=>	array(
//					'year3'		=>	'conferenceEndYear',
				),
				'resource_creator' =>	array(
				),
// In addition to the collectionType, title and shortTitle of the collection, all these fields must match in order for a new collection to be judged to be the same as an existing one
				'match' => array('field1'),
// Minimum fields for display of collection in selection box in addition to title and titleshort
				'display' => array('field1'),
			);
		$this->web = array(
				'resource'	=>	array(
//					'field1'	=>	'journalVolumeNumber',
//					'field2'	=>	'journalIssueNumber',
					),
				'resource_misc'	=>	array(
					'publisher'	=>	'publisher',
					),
				'resource_year'	=>	array(
//					'year1'		=>	'publicationYear',
				),
				'resource_creator' =>	array(
				),
// In addition to the collectionType, title and shortTitle of the collection, all these fields must match in order for a new collection to be judged to be the same as an existing one
//				'match' => array('field1', 'field2', 'year1'),
				'match' => array(),
// Minimum fields for display of collection in selection box in addition to title and titleshort
//				'display' => array('field1', 'field2', 'year1'),
				'display' => array(),
			);
		$this->web_encyclopedia = array(
				'resource'	=>	array(
					),
				'resource_misc'	=>	array(
					'publisher'	=>	'publisher',
					),
				'resource_year'	=>	array(
//					'year1'		=>	'publicationYear',
				),
				'resource_creator' =>	array(
				),
// In addition to the collectionType, title and shortTitle of the collection, all these fields must match in order for a new collection to be judged to be the same as an existing one
				'match' => array(),
// Minimum fields for display of collection in selection box in addition to title and titleshort
				'display' => array(),
			);
		$this->thesis = array(
				'resource'	=>	array(
//					'field3'	=>	'journalVolumeNumber',
//					'field4'	=>	'journalIssueNumber',
				),
				'resource_misc'	=>	array(
					),
				'resource_year'	=>	array(
//					'year2'		=>	'publicationYear',
				),
				'resource_creator' =>	array(
				),
// In addition to the collectionType, title and shortTitle of the collection, all these fields must match in order for a new collection to be judged to be the same as an existing one
//				'match' => array('field3', 'field4', 'year2'),
				'match' => array(),
// Minimum fields for display of collection in selection box in addition to title and titleshort
//				'display' => array('field3', 'field4', 'year2'),
				'display' => array(),
			);
		$this->music = array(
				'resource'	=>	array(
					'field2'	=>	'medium',
				),
				'resource_misc'	=>	array(
					'publisher'	=>	'publisher',
					),
				'resource_year'	=>	array(
					'year1'		=>	'publicationYear',
				),
				'resource_creator' =>	array(
				),
// In addition to the collectionType, title and shortTitle of the collection, all these fields must match in order for a new collection to be judged to be the same as an existing one
				'match' => array('publisher', 'year1'),
// Minimum fields for display of collection in selection box in addition to title and titleshort
				'display' => array('year1'),
			);
		$this->manuscript = array(
				'resource'	=>	array(
				),
				'resource_misc'	=>	array(
					),
				'resource_year'	=>	array(
				),
				'resource_creator' =>	array(
				),
// In addition to the collectionType, title and shortTitle of the collection, all these fields must match in order for a new collection to be judged to be the same as an existing one
				'match' => array(), // empty array required
// Minimum fields for display of collection in selection box in addition to title and titleshort
				'display' => array(), // empty array required
			);
		$this->miscellaneous = array(
				'resource'	=>	array(
					'field2'	=>	'medium',
				),
				'resource_misc'	=>	array(
					'publisher'	=>	'publisher',
					),
				'resource_year'	=>	array(
				),
				'resource_creator' =>	array(
				),
// In addition to the collectionType, title and shortTitle of the collection, all these fields must match in order for a new collection to be judged to be the same as an existing one
				'match' => array(), // empty array required
// Minimum fields for display of collection in selection box in addition to title and titleshort
				'display' => array(), // empty array required
			);
	}
}
?>
